
int bsearch_1(int l, int r)
{
    while(l < r)
    {
        int mid = (l + r)/2;
        if(check(mid)) r = mid;   // check 检验mid 是否满足性质
        else l = mid + 1;
    }
    return l;
}

int bsearch_2(int l, int r)
{
    while(l < r)
    {
        int mid = (l + r + 1)/2;
        if(check(mid)) l = mid;   // check 检验mid 是否满足性质
        else r = mid - 1;
    }
    return l;
}
